Integrand size = 39, antiderivative size = 187 \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {C (b \cos (c+d x))^{3+n} \sin (c+d x)}{b^3 d (4+n)}-\frac {(C (3+n)+A (4+n)) (b \cos (c+d x))^{3+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+n}{2},\frac {5+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^3 d (3+n) (4+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (b \cos (c+d x))^{4+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^4 d (4+n) \sqrt {\sin ^2(c+d x)}} \]
[Out]
Time = 0.24 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {16, 3102, 2827, 2722} \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {(A (n+4)+C (n+3)) \sin (c+d x) (b \cos (c+d x))^{n+3} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+3}{2},\frac {n+5}{2},\cos ^2(c+d x)\right )}{b^3 d (n+3) (n+4) \sqrt {\sin ^2(c+d x)}}-\frac {B \sin (c+d x) (b \cos (c+d x))^{n+4} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+4}{2},\frac {n+6}{2},\cos ^2(c+d x)\right )}{b^4 d (n+4) \sqrt {\sin ^2(c+d x)}}+\frac {C \sin (c+d x) (b \cos (c+d x))^{n+3}}{b^3 d (n+4)} \]
[In]
[Out]
Rule 16
Rule 2722
Rule 2827
Rule 3102
Rubi steps \begin{align*} \text {integral}& = \frac {\int (b \cos (c+d x))^{2+n} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx}{b^2} \\ & = \frac {C (b \cos (c+d x))^{3+n} \sin (c+d x)}{b^3 d (4+n)}+\frac {\int (b \cos (c+d x))^{2+n} (b (C (3+n)+A (4+n))+b B (4+n) \cos (c+d x)) \, dx}{b^3 (4+n)} \\ & = \frac {C (b \cos (c+d x))^{3+n} \sin (c+d x)}{b^3 d (4+n)}+\frac {B \int (b \cos (c+d x))^{3+n} \, dx}{b^3}+\frac {(C (3+n)+A (4+n)) \int (b \cos (c+d x))^{2+n} \, dx}{b^2 (4+n)} \\ & = \frac {C (b \cos (c+d x))^{3+n} \sin (c+d x)}{b^3 d (4+n)}-\frac {(C (3+n)+A (4+n)) (b \cos (c+d x))^{3+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+n}{2},\frac {5+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^3 d (3+n) (4+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (b \cos (c+d x))^{4+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^4 d (4+n) \sqrt {\sin ^2(c+d x)}} \\ \end{align*}
Time = 0.25 (sec) , antiderivative size = 153, normalized size of antiderivative = 0.82 \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {\cos ^2(c+d x) (b \cos (c+d x))^n \cot (c+d x) \left ((C (3+n)+A (4+n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+n}{2},\frac {5+n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}-(3+n) \left (C \sin ^2(c+d x)-B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )\right )}{d (3+n) (4+n)} \]
[In]
[Out]
\[\int \left (\cos ^{2}\left (d x +c \right )\right ) \left (\cos \left (d x +c \right ) b \right )^{n} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right )d x\]
[In]
[Out]
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int {\cos \left (c+d\,x\right )}^2\,{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right ) \,d x \]
[In]
[Out]